package com.gzcsqic.excelapp.test;

import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.util.PoiMergeCellUtil;
import com.gzcsqic.excelapp.utils.ExcelUtil;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Main2 {

    public static void main(String[] args) throws IOException {
        Map<String, Object> value = new HashMap<String, Object>();


        value.put("sampleNos-xcjl","sada");
        value.put("b","s是否ada");
        value.put("c","sdsda3gntrsf");


//        ExcelUtil.cloneSheet(new File("d:/col.xlsx"),0,"s2");

        TemplateExportParams params = new TemplateExportParams("d:/模板-扦样.xlsx",0);
        Workbook book = ExcelExportUtil.exportExcel(params, value);
//        CellRangeAddress craOne = new CellRangeAddress(0, 0, 6, 8);
//        book.getSheetAt(0).addMergedRegion(craOne);
//        craOne = new CellRangeAddress(1, 1, 6, 8);
//        book.getSheetAt(0).addMergedRegion(craOne);
//        craOne = new CellRangeAddress(2, 2, 6, 8);
//        book.getSheetAt(0).addMergedRegion(craOne);
        FileOutputStream fos = new FileOutputStream("D:/one.xlsx");
        book.write(fos);

        fos.close();


    }
}
